import React from 'react'
import MyNavBar from '@/components/MyNavBar'
import {Route,Switch,Redirect} from 'react-router-dom'
import { lazy,Suspense } from 'react'
import Loading from '@/components/Loading'
const Step1 = lazy(()=> import ('@/views/Step1'))
const Step2 = lazy(()=> import ('@/views/Step2'))
const Step3 = lazy(()=> import ('@/views/Step3'))


export default function Regist() {
  return (
    <div className='regist'>
      <MyNavBar isShow={false}>京东注册</MyNavBar>
      {/* 二级组件显示的坑 */}
      <Suspense fallback={<Loading></Loading>}>
      <Switch>
        {/* Route既是路由规则又是坑 */}
        <Route path='/regist/step1' component={Step1} ></Route>
        <Route path='/regist/step2' component={Step2} ></Route>
        <Route path='/regist/step3' component={Step3} ></Route>
        <Redirect from='/regist' to='/regist/step1' exact></Redirect>

      </Switch>
      </Suspense>

    </div>
  )
}
